package com.molichuxing.job;

import com.molichuxing.service.StatisticsOrderService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: renzhengyu
 * @Description: 订阅/专属超里程未还车数量  10分钟一次
 * @Date: Created in 11:11 2019/11/15
 * @Modified By:
 **/
@JobHandler(value="statisticsOrderOverrideHandler")
@Component
public class StatisticsOrderOverrideHandler extends IJobHandler {

    private static final Logger log = Logger.getLogger(StatisticsOrderOverrideHandler.class);

    @Resource
    private StatisticsOrderService statisticsOrderService;

    public StatisticsOrderOverrideHandler() {
        super();
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public void destroy() {
        super.destroy();
    }


    @Override
    public ReturnT<String> execute(String s) throws Exception {
        ReturnT<String> returnT = ReturnT.SUCCESS;
        log.info("==============================首页风险统计 订阅/专属超里程未还车数量   开始定时任务");
        Boolean result = statisticsOrderService.orderOverrideHandler();
        log.info("==============================首页风险统计 订阅/专属超里程未还车数量  结束定时任务result：");
        returnT.setContent("首页风险统计 订阅/专属超里程未还车数量数据 定时任务的任务结果result："+ result);
        return returnT;
    }
}
